Optimal. Leaf size=146 \[ -\frac {8 \sqrt [4]{-1} a^3 (A-i B) \text {ArcTan}\left ((-1)^{3/4} \sqrt {\tan (c+d x)}\right )}{d}-\frac {16 a^3 (5 A-6 i B) \sqrt {\tan (c+d x)}}{15 d}+\frac {2 i a B \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))^2}{5 d}-\frac {2 (5 A-9 i B) \sqrt {\tan (c+d x)} \left (a^3+i a^3 \tan (c+d x)\right )}{15 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.25, antiderivative size = 146, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 36, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {3675, 3673,
3614, 211} \begin {gather*} -\frac {8 \sqrt [4]{-1} a^3 (A-i B) \text {ArcTan}\left ((-1)^{3/4} \sqrt {\tan (c+d x)}\right )}{d}-\frac {16 a^3 (5 A-6 i B) \sqrt {\tan (c+d x)}}{15 d}-\frac {2 (5 A-9 i B) \sqrt {\tan (c+d x)} \left (a^3+i a^3 \tan (c+d x)\right )}{15 d}+\frac {2 i a B \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))^2}{5 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 3614
Rule 3673
Rule 3675
Rubi steps
\begin {align*} \int \frac {(a+i a \tan (c+d x))^3 (A+B \tan (c+d x))}{\sqrt {\tan (c+d x)}} \, dx &=\frac {2 i a B \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))^2}{5 d}+\frac {2}{5} \int \frac {(a+i a \tan (c+d x))^2 \left (\frac {1}{2} a (5 A-i B)+\frac {1}{2} a (5 i A+9 B) \tan (c+d x)\right )}{\sqrt {\tan (c+d x)}} \, dx\\ &=\frac {2 i a B \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))^2}{5 d}-\frac {2 (5 A-9 i B) \sqrt {\tan (c+d x)} \left (a^3+i a^3 \tan (c+d x)\right )}{15 d}+\frac {4}{15} \int \frac {(a+i a \tan (c+d x)) \left (a^2 (5 A-3 i B)+2 a^2 (5 i A+6 B) \tan (c+d x)\right )}{\sqrt {\tan (c+d x)}} \, dx\\ &=-\frac {16 a^3 (5 A-6 i B) \sqrt {\tan (c+d x)}}{15 d}+\frac {2 i a B \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))^2}{5 d}-\frac {2 (5 A-9 i B) \sqrt {\tan (c+d x)} \left (a^3+i a^3 \tan (c+d x)\right )}{15 d}+\frac {4}{15} \int \frac {15 a^3 (A-i B)+15 a^3 (i A+B) \tan (c+d x)}{\sqrt {\tan (c+d x)}} \, dx\\ &=-\frac {16 a^3 (5 A-6 i B) \sqrt {\tan (c+d x)}}{15 d}+\frac {2 i a B \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))^2}{5 d}-\frac {2 (5 A-9 i B) \sqrt {\tan (c+d x)} \left (a^3+i a^3 \tan (c+d x)\right )}{15 d}+\frac {\left (120 a^6 (A-i B)^2\right ) \text {Subst}\left (\int \frac {1}{15 a^3 (A-i B)-15 a^3 (i A+B) x^2} \, dx,x,\sqrt {\tan (c+d x)}\right )}{d}\\ &=-\frac {8 \sqrt [4]{-1} a^3 (A-i B) \tan ^{-1}\left ((-1)^{3/4} \sqrt {\tan (c+d x)}\right )}{d}-\frac {16 a^3 (5 A-6 i B) \sqrt {\tan (c+d x)}}{15 d}+\frac {2 i a B \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))^2}{5 d}-\frac {2 (5 A-9 i B) \sqrt {\tan (c+d x)} \left (a^3+i a^3 \tan (c+d x)\right )}{15 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 5.84, size = 273, normalized size = 1.87 \begin {gather*} \frac {\cos ^4(c+d x) \left (\frac {8 (A-i B) e^{-3 i c} \sqrt {-\frac {i \left (-1+e^{2 i (c+d x)}\right )}{1+e^{2 i (c+d x)}}} \tanh ^{-1}\left (\sqrt {\frac {-1+e^{2 i (c+d x)}}{1+e^{2 i (c+d x)}}}\right )}{\sqrt {\frac {-1+e^{2 i (c+d x)}}{1+e^{2 i (c+d x)}}}}-\frac {1}{15} \sec ^2(c+d x) (\cos (3 c)-i \sin (3 c)) (45 A-57 i B+9 (5 A-7 i B) \cos (2 (c+d x))+5 (i A+3 B) \sin (2 (c+d x))) \sqrt {\tan (c+d x)}\right ) (a+i a \tan (c+d x))^3 (A+B \tan (c+d x))}{d (\cos (d x)+i \sin (d x))^3 (A \cos (c+d x)+B \sin (c+d x))} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 252 vs. \(2 (122 ) = 244\).
time = 0.04, size = 253, normalized size = 1.73
method | result | size |
derivativedivides | \(\frac {a^{3} \left (-\frac {2 i B \left (\tan ^{\frac {5}{2}}\left (d x +c \right )\right )}{5}-\frac {2 i A \left (\tan ^{\frac {3}{2}}\left (d x +c \right )\right )}{3}-2 B \left (\tan ^{\frac {3}{2}}\left (d x +c \right )\right )+8 i B \left (\sqrt {\tan }\left (d x +c \right )\right )-6 A \left (\sqrt {\tan }\left (d x +c \right )\right )+\frac {\left (-4 i B +4 A \right ) \sqrt {2}\, \left (\ln \left (\frac {1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )+\tan \left (d x +c \right )}{1-\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )+\tan \left (d x +c \right )}\right )+2 \arctan \left (1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )\right )+2 \arctan \left (-1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )\right )\right )}{4}+\frac {\left (4 i A +4 B \right ) \sqrt {2}\, \left (\ln \left (\frac {1-\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )+\tan \left (d x +c \right )}{1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )+\tan \left (d x +c \right )}\right )+2 \arctan \left (1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )\right )+2 \arctan \left (-1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )\right )\right )}{4}\right )}{d}\) | \(253\) |
default | \(\frac {a^{3} \left (-\frac {2 i B \left (\tan ^{\frac {5}{2}}\left (d x +c \right )\right )}{5}-\frac {2 i A \left (\tan ^{\frac {3}{2}}\left (d x +c \right )\right )}{3}-2 B \left (\tan ^{\frac {3}{2}}\left (d x +c \right )\right )+8 i B \left (\sqrt {\tan }\left (d x +c \right )\right )-6 A \left (\sqrt {\tan }\left (d x +c \right )\right )+\frac {\left (-4 i B +4 A \right ) \sqrt {2}\, \left (\ln \left (\frac {1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )+\tan \left (d x +c \right )}{1-\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )+\tan \left (d x +c \right )}\right )+2 \arctan \left (1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )\right )+2 \arctan \left (-1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )\right )\right )}{4}+\frac {\left (4 i A +4 B \right ) \sqrt {2}\, \left (\ln \left (\frac {1-\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )+\tan \left (d x +c \right )}{1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )+\tan \left (d x +c \right )}\right )+2 \arctan \left (1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )\right )+2 \arctan \left (-1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )\right )\right )}{4}\right )}{d}\) | \(253\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.52, size = 196, normalized size = 1.34 \begin {gather*} -\frac {6 i \, B a^{3} \tan \left (d x + c\right )^{\frac {5}{2}} + 10 \, {\left (i \, A + 3 \, B\right )} a^{3} \tan \left (d x + c\right )^{\frac {3}{2}} + 30 \, {\left (3 \, A - 4 i \, B\right )} a^{3} \sqrt {\tan \left (d x + c\right )} - 15 \, {\left (2 \, \sqrt {2} {\left (\left (i + 1\right ) \, A - \left (i - 1\right ) \, B\right )} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} + 2 \, \sqrt {\tan \left (d x + c\right )}\right )}\right ) + 2 \, \sqrt {2} {\left (\left (i + 1\right ) \, A - \left (i - 1\right ) \, B\right )} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} - 2 \, \sqrt {\tan \left (d x + c\right )}\right )}\right ) - \sqrt {2} {\left (\left (i - 1\right ) \, A + \left (i + 1\right ) \, B\right )} \log \left (\sqrt {2} \sqrt {\tan \left (d x + c\right )} + \tan \left (d x + c\right ) + 1\right ) + \sqrt {2} {\left (\left (i - 1\right ) \, A + \left (i + 1\right ) \, B\right )} \log \left (-\sqrt {2} \sqrt {\tan \left (d x + c\right )} + \tan \left (d x + c\right ) + 1\right )\right )} a^{3}}{15 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 447 vs. \(2 (116) = 232\).
time = 2.35, size = 447, normalized size = 3.06 \begin {gather*} \frac {2 \, {\left (15 \, \sqrt {-\frac {{\left (i \, A^{2} + 2 \, A B - i \, B^{2}\right )} a^{6}}{d^{2}}} {\left (d e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \log \left (-\frac {2 \, {\left ({\left (A - i \, B\right )} a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + \sqrt {-\frac {{\left (i \, A^{2} + 2 \, A B - i \, B^{2}\right )} a^{6}}{d^{2}}} {\left (i \, d e^{\left (2 i \, d x + 2 i \, c\right )} + i \, d\right )} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{{\left (-i \, A - B\right )} a^{3}}\right ) - 15 \, \sqrt {-\frac {{\left (i \, A^{2} + 2 \, A B - i \, B^{2}\right )} a^{6}}{d^{2}}} {\left (d e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \log \left (-\frac {2 \, {\left ({\left (A - i \, B\right )} a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + \sqrt {-\frac {{\left (i \, A^{2} + 2 \, A B - i \, B^{2}\right )} a^{6}}{d^{2}}} {\left (-i \, d e^{\left (2 i \, d x + 2 i \, c\right )} - i \, d\right )} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{{\left (-i \, A - B\right )} a^{3}}\right ) - 2 \, {\left ({\left (25 \, A - 39 i \, B\right )} a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, {\left (15 \, A - 19 i \, B\right )} a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + 4 \, {\left (5 \, A - 6 i \, B\right )} a^{3}\right )} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )}}{15 \, {\left (d e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - i a^{3} \left (\int \left (- 3 A \sqrt {\tan {\left (c + d x \right )}}\right )\, dx + \int A \tan ^{\frac {5}{2}}{\left (c + d x \right )}\, dx + \int \left (- 3 B \tan ^{\frac {3}{2}}{\left (c + d x \right )}\right )\, dx + \int B \tan ^{\frac {7}{2}}{\left (c + d x \right )}\, dx + \int \frac {i A}{\sqrt {\tan {\left (c + d x \right )}}}\, dx + \int \left (- 3 i A \tan ^{\frac {3}{2}}{\left (c + d x \right )}\right )\, dx + \int i B \sqrt {\tan {\left (c + d x \right )}}\, dx + \int \left (- 3 i B \tan ^{\frac {5}{2}}{\left (c + d x \right )}\right )\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.94, size = 127, normalized size = 0.87 \begin {gather*} \frac {\left (4 i - 4\right ) \, \sqrt {2} {\left (-i \, A a^{3} - B a^{3}\right )} \arctan \left (-\left (\frac {1}{2} i - \frac {1}{2}\right ) \, \sqrt {2} \sqrt {\tan \left (d x + c\right )}\right )}{d} - \frac {2 \, {\left (3 i \, B a^{3} d^{4} \tan \left (d x + c\right )^{\frac {5}{2}} + 5 i \, A a^{3} d^{4} \tan \left (d x + c\right )^{\frac {3}{2}} + 15 \, B a^{3} d^{4} \tan \left (d x + c\right )^{\frac {3}{2}} + 45 \, A a^{3} d^{4} \sqrt {\tan \left (d x + c\right )} - 60 i \, B a^{3} d^{4} \sqrt {\tan \left (d x + c\right )}\right )}}{15 \, d^{5}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 7.16, size = 257, normalized size = 1.76 \begin {gather*} -\frac {6\,A\,a^3\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}}{d}-\frac {A\,a^3\,{\mathrm {tan}\left (c+d\,x\right )}^{3/2}\,2{}\mathrm {i}}{3\,d}+\frac {B\,a^3\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\,8{}\mathrm {i}}{d}-\frac {2\,B\,a^3\,{\mathrm {tan}\left (c+d\,x\right )}^{3/2}}{d}-\frac {B\,a^3\,{\mathrm {tan}\left (c+d\,x\right )}^{5/2}\,2{}\mathrm {i}}{5\,d}+\frac {\sqrt {2}\,A\,a^3\,\ln \left (A\,a^3\,d\,8{}\mathrm {i}+\sqrt {2}\,A\,a^3\,d\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\,\left (-4+4{}\mathrm {i}\right )\right )\,\left (2-2{}\mathrm {i}\right )}{d}-\frac {\sqrt {-16{}\mathrm {i}}\,A\,a^3\,\ln \left (A\,a^3\,d\,8{}\mathrm {i}+2\,\sqrt {-16{}\mathrm {i}}\,A\,a^3\,d\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\right )}{d}+\frac {\sqrt {2}\,B\,a^3\,\ln \left (8\,B\,a^3\,d+\sqrt {2}\,B\,a^3\,d\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\,\left (-4-4{}\mathrm {i}\right )\right )\,\left (2+2{}\mathrm {i}\right )}{d}-\frac {\sqrt {16{}\mathrm {i}}\,B\,a^3\,\ln \left (8\,B\,a^3\,d+2\,\sqrt {16{}\mathrm {i}}\,B\,a^3\,d\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________